// src/utils/db.js
const mysql = require('mysql2/promise');

const pool = mysql.createPool({
  host: process.env.MYSQL_HOST,  // 使用环境变量
  port: process.env.MYSQL_PORT,  // 使用环境变量
  user: 'root',
  password: '123456',
  database: 'his_mockup',
  waitForConnections: true,
  connectionLimit: 10,
  queueLimit: 0
});

// module.exports = pool.promise();
module.exports = pool;